home *** CD-ROM | disk | FTP | other *** search
Text File | 1992-02-07 | 5.2 KB | 137 lines | [TEXT/ttxt] |
- N & C MacsBug Macros/Templates
- v1.2
-
- Changes from v1.1 to v1.2:
- • Added driver number check to the .XPP and .DSP Driver 'mxbm' resources.
- You no longer have to compare for the driver number yourself.
- • Changed the documentation to reflect the changes.
-
- Changes from v1.0 to v1.1:
- • Added some extra parenthesis to the macros so you can add additional
- conditions.
- • Fixed a couple of macros in the .MPP Driver 'mxbm' resource.
- • Fixed some templates in the PPC ParamBlocks 'mxwt' resource.
-
- This ResEdit file contains MacsBug 'mxbm' and 'mxwt' for the .MPP, .ATP,
- .XPP, and .DSP AppleTalk drivers and for the PPC Toolbox. Add these
- resources to MacsBug's Debugger Prefs file and you'll be able to easily
- trap on AppleTalk driver control calls and PPC Toolbox calls and you'll
- also be able to dump the parameter blocks and associated data structures
- used by those calls.
-
- After adding the resources to the Debugger Prefs file and rebooting, you
- can get a list of the macros with MacsBug's MCD (list macros) command
- and a list of the templates with MacsBug's TMP (list templates) command.
- Here's a short explanation of what you get with each resource.
-
-
- The .MPP Driver 'mxbm' Resource
-
- These macros let you trap on any call to the .MPP driver with MacsBug's
- ATB command. Since the .MPP driver always uses the same dRef number
- ($fff6), these macros match on both the dRef number (passed in ioRefNum)
- and the csCode in the parameter block passed to _Control. For example,
- the LookupName macro expands to:
-
- †Control ((ra0+18)^=fff600fb)
-
- so an example using the LookupName macro to trap on NBP LookupName calls
- would be:
-
- ATB LookupName
-
-
- The .ATP Driver 'mxbm' Resource
-
- These macros let you trap on any call to the .ATP driver with MacsBug's
- ATB command. Since the .ATB driver always uses the same dRef number
- ($fff5), these macros match on both the dRef number (passed in ioRefNum)
- and the csCode in the parameter block passed to _Control.
-
-
- The .XPP Driver 'mxbm' Resource
-
- These macros let you trap on any call to the .XPP driver with MacsBug's
- ATB command. Since the .XPP driver always uses the same dRef number
- ($ffd7), these macros match on both the dRef number (passed in ioRefNum)
- and the csCode in the parameter block passed to _Control.
-
- The .DSP Driver 'mxbm' Resource
-
- These macros let you trap on any call to the .DSP driver with MacsBug's
- ATB command. Since the .DSP driver does not always use the same dRef
- number, these macros match only on the csCode in the parameter block
- passed to _Control. This means you'll have to add your own additional
- expression to match on the dRef number. You can get the dRef number of
- the .DSP driver with the MacsBug DRVR dcmd.
-
- Assuming you got the .DSP driver's dRef number (using the DRVR dsmd)
- and it is $ffcc, here's how you could use the dspOpen macro:
-
- ATB (dspOpen) & ((ra0+18)^.w=ffcc.w)
-
- The PPC Toolbox 'mxbm' Resource
-
- These macros let you trap on any call to the PPC Toolbox with MacsBug's
- ATB command. Since some PPC Toolbox calls can be made both
- synchronously or asynchronously, there are two macros for those calls
- (for example: PPCOpenSync and PPCOpenAsync).
-
- The 'mxwt' Template Resources
-
- These templates let you display AppleTalk and PPC Toolbox parameter
- blocks and their associated data structures the way you'd probably want
- to see them.
-
- The resource titled "AppleTalk Types" must be included in the Debugger
- Prefs file to use the MPP, ATP, XPP, DSP, or PPC ParamBlocks resources.
- That's because the other templates build on templates defined in
- AppleTalk Types.
-
- Here's an example of what you'll see using one of the templates
- (LookupNameParm):
-
- DM RA0 LookupNameParm
-
- Displaying LookupNameParm at 000B8E6C
- 000B8E6C MPPParamBlock
- 000B8E6C qLink NIL
- 000B8E70 qType 0002
- 000B8E72 ioTrap A004
- 000B8E74 ioCmdAddr 000BB110 ->
- 000B8E78 ioCompletion NIL
- 000B8E7C ioResult 0000
- 000B8E7E ioNamePtr 2000FFFF is a bad pointer
- 000B8E82 ioVRefNum FFFF
- 000B8E84 ioRefNum FFF6
- 000B8E86 csCode 00FB
- 000B8E88 interval 07
- 000B8E89 count 05
- 000B8E8A entityPtr 000B8EAA ->
- 000B8EAA objStr "="
- 000B8EAC typeStr "AFPServer"
- 000B8EB6 zoneStr "*"
- 000B8E8E retBuffPtr 000BD108 ->
- 000B8E92 retBuffSize 0400
- 000B8E94 maxToGet 0100
- 000B8E96 numGotten 0000
-
- You can use the templates along with the macros to trap on a call and
- then display the parameter block passed to that call. For example:
-
- ATB LookupName ';DM RA0 LookupNameParm'
-
- will trap on LookupName and then display the parameter block passed to
- LookupName (pointed to by RA0).
-
-
- Conclusion
-
- I knocked these macros and templates out late at night and I haven't had
- a chance to use everyone of them, so there may be a few mistakes. If
- you find anything wrong, or have any good ideas how I can improve
- anything, just send me a Link at MACDTS.
-
- Jim Luther
- Apple Developer Technical Support
-